import request from '@/config/axios'

// 项目需求基线表单 VO
export interface RequireBaselineVO {
  id: number // 自增主键
  baselineId: string // 需求基线唯一编号
  baselineName: string // 需求基线名称
  baselineCreationTime: Date // 需求基线创建时间
  baselineCreator: string // 需求基线创建用户
  includedRequirementIds: string // 基线包含的需求编号列表
  remarks: string // 备注
}

// 项目需求基线表单 API
export const RequireBaselineApi = {
  // 查询项目需求基线表单分页
  getRequireBaselinePage: async (params: any) => {
    return await request.get({ url: `/project/require-baseline/page`, params })
  },

  // 查询项目需求基线表单详情
  getRequireBaseline: async (id: number) => {
    return await request.get({ url: `/project/require-baseline/get?id=` + id })
  },

  // 新增项目需求基线表单
  createRequireBaseline: async (data: RequireBaselineVO) => {
    return await request.post({ url: `/project/require-baseline/create`, data })
  },

  // 修改项目需求基线表单
  updateRequireBaseline: async (data: RequireBaselineVO) => {
    return await request.put({ url: `/project/require-baseline/update`, data })
  },

  // 删除项目需求基线表单
  deleteRequireBaseline: async (id: number) => {
    return await request.delete({ url: `/project/require-baseline/delete?id=` + id })
  },

  // 导出项目需求基线表单 Excel
  exportRequireBaseline: async (params) => {
    return await request.download({ url: `/project/require-baseline/export-excel`, params })
  },
}